package com.java.chainofresponsibility;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: TongRui乀
 * @Date: 2019/3/6 14:25
 * @description：
 */
@Slf4j
public class PlayerB extends Player {

    public PlayerB(Player player){
        super.setNext(player);
    }

    @Override
    public void handler(int index) {

        if(index == 2){
            log.info("B 唱歌");
        }else{
            log.info("B 向下传");
            next(index + 1);
        }

    }
}
